<template>
<el-container class="home_container">
  <el-header class="home_top">朗驰科技人员管理系统
    <el-button type="info" class="buttons" @click="logout">退出</el-button>
  </el-header>
  <el-container>
    <el-aside width="202px"><el-menu
      default-active="2"
      class="el-menu-vertical-demo el-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-menu-item index="1">
        <i class="el-icon-location"></i>
        <span slot="title">技术</span>
      </el-menu-item>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>人力</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="1-1"><router-link :to="{name:'roster'}" tag="div">员工花名册</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-2"><router-link :to="{name:'attendance'}" tag="div">员工考勤</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-3"><router-link :to="{name:'wages'}" tag="div">员工工资</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-4"><router-link :to="{name:'enterpost'}" tag="div">员工入职名单</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-5"><router-link :to="{name:'leavepost'}" tag="div">员工离职名单</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-6"><router-link :to="{name:'personnellist'}" tag="div">培训人员名单</router-link></el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item index="1-7"><router-link :to="{name:'becomeregular'}" tag="div">员工转正名单</router-link></el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      
      <el-menu-item index="3">
        <i class="el-icon-document"></i>
        <span slot="title">后勤</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title">企宣</span>
      </el-menu-item>
    </el-menu></el-aside>
    <el-main><router-view>111111</router-view></el-main>
  </el-container>
</el-container>
</template>

<script>
export default {
  methods: {
    // 退出登陆，清除Token，返回login
    logout() {
      window.sessionStorage.clear()
      this.$router.push('/login')
    },
    handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
  },
}
</script>

<style lang="less" scoped>
.home_container {
  background-color: #fff;
  height: 100vh;
  .home_top{
    position: relative;
  background-color: #2b4b6b;
  font-size: 30px;
  color: white;
  text-align: center;
  line-height: 60px;
  .buttons{
    position: absolute;
    right: 35px;
    top: 10px;
  }
}
.el-demo{
    height: 93.8vh;
}
}

</style>

